package com.PAT.UnSatisfying;

import java.text.DecimalFormat;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/11/22/9:57
 * @Description:
 * @Target: 差5
 */
public class 数列的片段和 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int len = input.nextInt();
        double[] arr = new double[len];
        int i = 0;
        while (i<=len-1){
            arr[i]=input.nextDouble();
            i++;
        }

        DecimalFormat df = new DecimalFormat("#0.00");

        double v = CountArrayByTwoFor(arr);
        System.out.println(df.format(v));



    }



    // 进来一个数组,类似插入法的计算,输出总和
    public static double CountArrayByTwoFor(double[] doubles){
        double sum = 0;
        int len = doubles.length-1;
        for (int i = 0; i <= len; i++) {
            for (int j = i; j <= len; j++) {
                sum+=doubles[j]*(len+1-j);
            }
        }

        return sum;
    }


}
